<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 3.9.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/images/logo.svg" color="#222">

<link rel="stylesheet" href="/css/main.css">


<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@5/css/all.min.css">

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"ywg.imfast.io","root":"/","scheme":"Muse","version":"7.8.0","exturl":false,"sidebar":{"position":"right","Muse | Mist":320,"display":"post","padding":18,"offset":12,"onmobile":true},"copycode":{"enable":true,"show_result":true,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":false,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}}};
  </script>

  <meta name="description" content="小程序使用场景：1. 同App进行互补，提供同app类似的功能，比app操作更加简洁的轻应用 2. 用户使用频率不高，但又不得不用的功能软件. 小程序 =&amp;gt; 相当于单页应用app 结构：入口文件——&amp;gt;一级页面——&amp;gt;二级页面。。。。 启动过程：　　项目的启动根文件app.js        生命周期: onLaunch()只加载一次,有三大功能: 浏览器缓存进行存取数据；用登陆成功">
<meta name="keywords" content="python 前端">
<meta property="og:type" content="article">
<meta property="og:title" content="中·庸">
<meta property="og:url" content="https://ywg.imfast.io/2019/07/20/miniapp/index.html">
<meta property="og:site_name" content="中·庸">
<meta property="og:description" content="小程序使用场景：1. 同App进行互补，提供同app类似的功能，比app操作更加简洁的轻应用 2. 用户使用频率不高，但又不得不用的功能软件. 小程序 =&amp;gt; 相当于单页应用app 结构：入口文件——&amp;gt;一级页面——&amp;gt;二级页面。。。。 启动过程：　　项目的启动根文件app.js        生命周期: onLaunch()只加载一次,有三大功能: 浏览器缓存进行存取数据；用登陆成功">
<meta property="og:locale" content="zh-CN">
<meta property="og:updated_time" content="2020-04-04T04:00:22.954Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="中·庸">
<meta name="twitter:description" content="小程序使用场景：1. 同App进行互补，提供同app类似的功能，比app操作更加简洁的轻应用 2. 用户使用频率不高，但又不得不用的功能软件. 小程序 =&amp;gt; 相当于单页应用app 结构：入口文件——&amp;gt;一级页面——&amp;gt;二级页面。。。。 启动过程：　　项目的启动根文件app.js        生命周期: onLaunch()只加载一次,有三大功能: 浏览器缓存进行存取数据；用登陆成功">

<link rel="canonical" href="https://ywg.imfast.io/2019/07/20/miniapp/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title> | 中·庸</title>
  


  <script data-pjax>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?5b0bac5c2f7738d023171c65307bcc43";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>




  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">中·庸</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
      <p class="site-subtitle" itemprop="description">斯人若彩虹，遇上方知有</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/" rel="section"><i class="home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/tags/" rel="section"><i class="tags fa-fw"></i>标签<span class="badge">9</span></a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/categories/" rel="section"><i class="th fa-fw"></i>分类<span class="badge">9</span></a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/archives/" rel="section"><i class="archive fa-fw"></i>归档<span class="badge">10</span></a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/about/" rel="section"><i class="user fa-fw"></i>关于</a>

  </li>
  </ul>
</nav>




</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://ywg.imfast.io/2019/07/20/miniapp/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/images/avatar.gif">
      <meta itemprop="name" content="zhiheng">
      <meta itemprop="description" content="programming and life">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="中·庸">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          
        </h1>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2019-07-20 13:19:18" itemprop="dateCreated datePublished" datetime="2019-07-20T13:19:18+08:00">2019-07-20</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2020-04-04 12:00:22" itemprop="dateModified" datetime="2020-04-04T12:00:22+08:00">2020-04-04</time>
              </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h2 id="小程序使用场景："><a href="#小程序使用场景：" class="headerlink" title="小程序使用场景："></a>小程序使用场景：</h2><pre><code>1. 同App进行互补，提供同app类似的功能，比app操作更加简洁的轻应用
2. 用户使用频率不高，但又不得不用的功能软件.
小程序 =&gt; 相当于单页应用app</code></pre><hr>
<p>结构：入口文件——&gt;一级页面——&gt;二级页面。。。。</p>
<p><strong>启动过程：</strong><br>　　项目的启动根文件app.js<br>        生命周期: onLaunch()只加载一次,有三大功能: 浏览器缓存进行存取数据；用登陆成功的回调；获取用户信息<br>　　当 app.js 执行结束后，小程序会按照开发者在 app.json 中定义的 pages 的顺序，逐一执行</p>
<p>js：模块化 import ‘相对路径’<br>    App()函数不能注册多个 App的生命周期是由微信客户端根据用户操作主动触发控制的 通过getApp()获取<br>        获取小程序的global 变量：var app = getApp()</p>
<p>　　Page（）页面构造函数，逻辑层通过Page实例（this）的 setData方法传递数据到渲染层setData（）传递数据实际是一个异步的过程，两个线程传输</p>
<p>wxml模板：<br>    <import src>  // template引入，不能多层传递导入，include可以<br>　　- include 可以将目标文件中除了 <template> <wxs> 外的整个代码引入 相当于是拷贝到 include 位置 //如公共组件抽象到独立文件<br>    <include src="header.wxml"></include></wxs></template></import></p>
<pre><code>- template
    定义:&lt;template name=&quot;&quot;&gt;
    使用:&lt;template is=&quot;&quot; data=&quot;{{}}&quot;/&gt;  // 可以灵活传参

- 自定义组件 （命名:小写字母 - _）
    结构类似一个页面，使用component要在配置文件说明
    - component样式不影响page样式 class样式默认隔离；component不允许使用id 标签 属性选择器
    - data：{}
    - page与component通信:
        properties:{} // 给组件传递数据，从page到组件
        externalClasses:[] //style 定义组件额外class；或者用？：切换style
        methods：{
            this.triggerEvent(&apos;发送给page事件的名称&apos;,{event.detail},{})
        } // 组件的事件传递给page 

整个wxml页面，最底层的标签是&lt;page&gt;&lt;/page&gt; 小程序组件继承全局的部分样式font，color ，pages可以继承所有全局的 // pc为&lt;html&gt;&lt;/html&gt;</code></pre><p>   <block wx:for> 循环代码块，block标签用来包裹循环多个语句，只接受控制属性；比view组件好<br>        wx:for-item=’’ 一般在多层嵌套中用来更改item，index变量名称<br>        wx:key=”唯一值属性/*this”  // *this代表item本身<br>        保留当前的状态;<br>        提高性能 setData()后不渲染,根据key直接排序</block></p>
<h3 id="wxml-html属性拓展【属性：值为data-函数】-公用属性：hidden，-data-自定义属性-传数据-，"><a href="#wxml-html属性拓展【属性：值为data-函数】-公用属性：hidden，-data-自定义属性-传数据-，" class="headerlink" title="wxml: html属性拓展【属性：值为data/函数】  公用属性：hidden， data-* 自定义属性(传数据)，"></a>wxml: html属性拓展【属性：值为data/函数】  公用属性：hidden， data-* 自定义属性(传数据)，</h3><pre><code>  bind/catch事件=&apos;事件处理函数（event）&apos;；
event对象：{
    type:
    target: 触发事件的源组件
    currentTarget: **有事件绑定**的当前组件  
        data-index属性用法： event.currentTarget.dataset.index //用事件返回
    &lt;!-- 正确获取 dataset 的姿势是使用 currentTarget 的 --&gt;
}

text行内元素
    - selectable=&apos;{{true}}&apos; 
    - &lt;text decode=&quot;{{true}}&quot;&gt; &lt;text&gt; // 解码，开启识别转义字符
button默认为block元素：
    - size=&quot;mini&quot;
    - type=&quot;primary/default/warn&quot;
    - plain 镂空
    - hover-class=&quot;&quot; 点击样式变化
view 块级容器
    - hover-stop-propagation=&quot;&quot; 是否阻止父标签点击态变化
image inline-block元素  默认大小320x240px
    - bindload=&quot;&quot; 监听图片加载完成
    - lazy-load 
    - wx.chooseImage({}) 调用相册
scroll-view
    - scroll-x
    - bindscroll
swiper:轮播容器； swiper-item:轮播项目

picker——选择器 --&gt;</code></pre><!-- 　　　　mode：日期data，时间time，地区regin，自定义range -->

<blockquote>
<p>VueJS中使用v-if控制元素是否渲染，使用v-show控制元素是否显示。微信小程序使用wx:if控制元素是否渲染，使用属性hidden控制元素显示</p>
</blockquote>
<h3 id="wxss样式："><a href="#wxss样式：" class="headerlink" title="wxss样式："></a>wxss样式：</h3><p>导入外联样式:  @import “common.wxss”;<br>内联样式 框架组件上支持使用 style、class 属性来控制组件的样式：静态的样式应统一写到 class 中独立解析,style文件接收动态的样式在运行时会进行解析，请尽量避免将静态的样式写进 style 中，以免影响渲染速度。</p>
<p>小程序尺寸单位：只有iphone6上:1px = 1rpx   2个物理像素（rpx） = 1px<br>一般水平方向rpx，垂直方向px   ，混合使用：rpx自适应，px不变<br>字体大小用px</p>
<p>line-height = font-size消除文字上下空白</p>
<p>wxss:</p>
<ul>
<li>设置全局字体样式app.wxss：<br>text{<br>font-family:MicroSoft yahei;<br>}</li>
<li>设置页面全屏样式及背景色：</li>
</ul>
<p>page{<br>height:100%;<br>background:#b3d4db;<br>}</p>
<ul>
<li>图片居中覆盖:<br>.audio{<br>  width:102rpx;<br>  height:110rpx;<br>  position: absolute;<br>  left: 50%;<br>  margin-left: -51rpx;//经典水平居中方式<br>  top:180rpx;<br>  margin-top: 20rpx;<br>  opacity:0.6;//透明度</li>
</ul>
<h3 id="wxs："><a href="#wxs：" class="headerlink" title="wxs："></a>wxs：</h3><p>在wxml中不能直接调用page/component中定义的函数<br>   导入： <wxs src="必须相对路径" module></wxs></p>
<ul>
<li>两大核心:事件回调和数据驱动[setData() bind=’event’]<ul>
<li>小程序内，事件的绑定是通过在 WXML 标签增加 <code>bind*</code> 属性来实现(catch抓住 会阻止事件继续冒泡) 当事件触发时，处理函数会响应，传入 event 对象，通过 event 对象可以获取事件触发时候的一些信息，包括时间戳、detail 等。<br>事件data传递: 因为小程序内的事件绑定都是在 WXML 中实现的，所以传递参数只能通过 WXML 上面的属性值来传递,传递到event对象里<blockquote>
<p>事件捕获capture-bind、capture-catch，后者将中断事件流捕获阶段和取消冒泡阶段</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<p>云开发调用:</p>
<p>```<br>wx.cloud.init({<br>  env: ‘tianqi-xxx’ # 初始化时，需要传入 env 参数<br>})</p>
<ul>
<li>云函数-在云端,相当于小程序后端  微信私有协议天然鉴权</li>
<li>云调用- 基于云函数免鉴权使用小程序开放接口</li>
<li>HTTP API 对接第三方服务器</li>
</ul>
<p><strong>云数据库</strong></p>
<p>增删改查:</p>
<ul>
<li><p>db.collection(“**”).add({<br>  data: {},<br>  success(){}<br>})</p>
</li>
<li><p>获取数据</p>
<ol>
<li>db.collection(“**”).get().then(res =&gt; {})</li>
<li>.doc(“id”).get().then()</li>
<li>.where({}).get().then()</li>
</ol>
</li>
<li><p>删除多条数据:<br>  只能在服务端,云函数</p>
</li>
</ul>
<p>-更新数据:<br>    1. 局部更新 update()<br>    2. 整体更新 set()</p>
<p>commend指令:<br>    _ = db.commend; 指令操作句柄<br>    state:_.eq({</p>
<pre><code>})</code></pre><h3 id="增强操作-云函数"><a href="#增强操作-云函数" class="headerlink" title="增强操作- 云函数"></a>增强操作- 云函数</h3><p>先配置云函数根目录</p>
<p><a href="http://www.wxapp-union.com/article-5861-1.html" target="_blank" rel="noopener">微信小程序api封装经验</a></p>

    </div>

    
    
    

      <footer class="post-footer">

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/2018/11/26/Google搜索/" rel="prev" title="Google搜索">
      <i class="fa fa-chevron-left"></i> Google搜索
    </a></div>
      <div class="post-nav-item">
    <a href="/2019/10/11/随笔/" rel="next" title="python配置">
      python配置 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          
    <div class="comments" id="gitalk-container"></div>

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#小程序使用场景："><span class="nav-number">1.</span> <span class="nav-text">小程序使用场景：</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#wxml-html属性拓展【属性：值为data-函数】-公用属性：hidden，-data-自定义属性-传数据-，"><span class="nav-number">1.1.</span> <span class="nav-text">wxml: html属性拓展【属性：值为data/函数】  公用属性：hidden， data-* 自定义属性(传数据)，</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#wxss样式："><span class="nav-number">1.2.</span> <span class="nav-text">wxss样式：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#wxs："><span class="nav-number">1.3.</span> <span class="nav-text">wxs：</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#增强操作-云函数"><span class="nav-number">1.4.</span> <span class="nav-text">增强操作- 云函数</span></a></li></ol></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  <p class="site-author-name" itemprop="name">zhiheng</p>
  <div class="site-description" itemprop="description">programming and life</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/archives/">
        
          <span class="site-state-item-count">10</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/categories/">
          
        <span class="site-state-item-count">9</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/tags/">
          
        <span class="site-state-item-count">9</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="https://github.com/yuwengeng" title="GitHub → https://github.com/yuwengeng" rel="noopener" target="_blank"><i class="github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.cnblogs.com/yuwengeng/" title="博客园 → https://www.cnblogs.com/yuwengeng/" rel="noopener" target="_blank"><i class="globe fa-fw"></i>博客园</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:yuwenzhiheng95@gmail.com" title="E-Mail → mailto:yuwenzhiheng95@gmail.com" rel="noopener" target="_blank"><i class="envelope fa-fw"></i>E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://weibo.com/yourname" title="Weibo → https://weibo.com/yourname" rel="noopener" target="_blank"><i class="weibo fa-fw"></i>Weibo</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://twitter.com/yourname" title="Twitter → https://twitter.com/yourname" rel="noopener" target="_blank"><i class="twitter fa-fw"></i>Twitter</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://instagram.com/yourname" title="Instagram → https://instagram.com/yourname" rel="noopener" target="_blank"><i class="instagram fa-fw"></i>Instagram</a>
      </span>
  </div>



      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 
  <span itemprop="copyrightYear">2020</span>
  <span class="with-love">
    <i class="heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">zhiheng</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://muse.theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Muse</a> 强力驱动
  </div>

        
<div class="busuanzi-count">
  <script data-pjax async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    <span class="post-meta-item" id="busuanzi_container_site_uv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item" id="busuanzi_container_site_pv" style="display: none;">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>








      </div>
    </footer>
  </div>

  
  <script src="//cdn.jsdelivr.net/npm/animejs@3.1.0/lib/anime.min.js"></script>
  <script src="//cdn.jsdelivr.net/gh/theme-next/theme-next-pjax@0/pjax.min.js"></script>
<script src="/js/utils.js"></script>
<script src="/js/schemes/muse.js"></script>
<script src="/js/next-boot.js"></script>
  <script>
var pjax = new Pjax({
  selectors: [
    'head title',
    '#page-configurations',
    '.content-wrap',
    '.post-toc-wrap',
    '.languages',
    '#pjax'
  ],
  switches: {
    '.post-toc-wrap': Pjax.switches.innerHTML
  },
  analytics: false,
  cacheBust: false,
  scrollTo : !CONFIG.bookmark.enable
});

window.addEventListener('pjax:success', () => {
  document.querySelectorAll('script[data-pjax], script#page-configurations, #pjax script').forEach(element => {
    var code = element.text || element.textContent || element.innerHTML || '';
    var parent = element.parentNode;
    parent.removeChild(element);
    var script = document.createElement('script');
    if (element.id) {
      script.id = element.id;
    }
    if (element.className) {
      script.className = element.className;
    }
    if (element.type) {
      script.type = element.type;
    }
    if (element.src) {
      script.src = element.src;
      // Force synchronous loading of peripheral JS.
      script.async = false;
    }
    if (element.dataset.pjax !== undefined) {
      script.dataset.pjax = '';
    }
    if (code !== '') {
      script.appendChild(document.createTextNode(code));
    }
    parent.appendChild(script);
  });
  NexT.boot.refresh();
  // Define Motion Sequence & Bootstrap Motion.
  if (CONFIG.motion.enable) {
    NexT.motion.integrator
      .init()
      .add(NexT.motion.middleWares.subMenu)
      .add(NexT.motion.middleWares.postList)
      .bootstrap();
  }
  NexT.utils.updateSidebarPosition();
});
</script>




  















    <div id="pjax">
  

  

<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.css">

<script>
NexT.utils.loadComments(document.querySelector('#gitalk-container'), () => {
  NexT.utils.getScript('//cdn.jsdelivr.net/npm/gitalk@1/dist/gitalk.min.js', () => {
    var gitalk = new Gitalk({
      clientID    : '24ef63b5f7c6e9d3a198',
      clientSecret: '5cceec5609a0910c5f361eaaefdbe57ae7c5d359',
      repo        : 'yuwengeng.github.io',
      owner       : 'yuwengeng',
      admin       : ['yuwengeng'],
      id          : '094a1e847a4de7433e3a4f0d5e5ba0fa',
        language: '',
      distractionFreeMode: true
    });
    gitalk.render('gitalk-container');
  }, window.Gitalk);
});
</script>

    </div>
</body>
</html>
